/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author damfercer
 */
@Entity
@Table(name = "company_visited_profile", catalog = "facetoframe", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CompanyVisitedProfile.findAll", query = "SELECT c FROM CompanyVisitedProfile c"),
    @NamedQuery(name = "CompanyVisitedProfile.findByIdCompanyVisitedProfile", query = "SELECT c FROM CompanyVisitedProfile c WHERE c.idCompanyVisitedProfile = :idCompanyVisitedProfile"),
    @NamedQuery(name = "CompanyVisitedProfile.findByVisitDate", query = "SELECT c FROM CompanyVisitedProfile c WHERE c.visitDate = :visitDate")})
public class CompanyVisitedProfile implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_COMPANY_VISITED_PROFILE")
    private Integer idCompanyVisitedProfile;
    @Basic(optional = false)
    @NotNull
    @Column(name = "VISIT_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date visitDate;
    @JoinColumn(name = "ID_COMPANY", referencedColumnName = "ID_COMPANY")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Company idCompany;
    @JoinColumn(name = "ID_CANDIDATE", referencedColumnName = "ID_CANDIDATE")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Candidate idCandidate;

    public CompanyVisitedProfile() {
    }

    public CompanyVisitedProfile(Integer idCompanyVisitedProfile) {
        this.idCompanyVisitedProfile = idCompanyVisitedProfile;
    }

    public CompanyVisitedProfile(Integer idCompanyVisitedProfile, Date visitDate) {
        this.idCompanyVisitedProfile = idCompanyVisitedProfile;
        this.visitDate = visitDate;
    }

    public Integer getIdCompanyVisitedProfile() {
        return idCompanyVisitedProfile;
    }

    public void setIdCompanyVisitedProfile(Integer idCompanyVisitedProfile) {
        this.idCompanyVisitedProfile = idCompanyVisitedProfile;
    }

    public Date getVisitDate() {
        return visitDate;
    }

    public void setVisitDate(Date visitDate) {
        this.visitDate = visitDate;
    }

    public Company getIdCompany() {
        return idCompany;
    }

    public void setIdCompany(Company idCompany) {
        this.idCompany = idCompany;
    }

    public Candidate getIdCandidate() {
        return idCandidate;
    }

    public void setIdCandidate(Candidate idCandidate) {
        this.idCandidate = idCandidate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCompanyVisitedProfile != null ? idCompanyVisitedProfile.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompanyVisitedProfile)) {
            return false;
        }
        CompanyVisitedProfile other = (CompanyVisitedProfile) object;
        if ((this.idCompanyVisitedProfile == null && other.idCompanyVisitedProfile != null) || (this.idCompanyVisitedProfile != null && !this.idCompanyVisitedProfile.equals(other.idCompanyVisitedProfile))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.CompanyVisitedProfile[ idCompanyVisitedProfile=" + idCompanyVisitedProfile + " ]";
    }
    
}
